home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-33 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  47.8 KB  |  1,158 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Blinking,  Next: Usual Display,  Prev: Temporary Displays,  Up: Display
  46.  
  47. Blinking Parentheses
  48. ====================
  49.  
  50.    This section describes the mechanism by which XEmacs shows a matching
  51. open parenthesis when the user inserts a close parenthesis.
  52.  
  53.  - Variable: blink-paren-function
  54.      The value of this variable should be a function (of no arguments)
  55.      to be called whenever a character with close parenthesis syntax is
  56.      inserted.  The value of `blink-paren-function' may be `nil', in
  57.      which case nothing is done.
  58.  
  59.           *Please note:* This variable was named `blink-paren-hook' in
  60.           older Emacs versions, but since it is not called with the
  61.           standard convention for hooks, it was renamed to
  62.           `blink-paren-function' in version 19.
  63.  
  64.  - Variable: blink-matching-paren
  65.      If this variable is `nil', then `blink-matching-open' does nothing.
  66.  
  67.  - Variable: blink-matching-paren-distance
  68.      This variable specifies the maximum distance to scan for a matching
  69.      parenthesis before giving up.
  70.  
  71.  - Variable: blink-matching-paren-delay
  72.      This variable specifies the number of seconds for the cursor to
  73.      remain at the matching parenthesis.  A fraction of a second often
  74.      gives good results, but the default is 1, which works on all
  75.      systems.
  76.  
  77.  - Function: blink-matching-open
  78.      This function is the default value of `blink-paren-function'.  It
  79.      assumes that point follows a character with close parenthesis
  80.      syntax and moves the cursor momentarily to the matching opening
  81.      character.  If that character is not already on the screen, it
  82.      displays the character's context in the echo area.  To avoid long
  83.      delays, this function does not search farther than
  84.      `blink-matching-paren-distance' characters.
  85.  
  86.      Here is an example of calling this function explicitly.
  87.  
  88.           (defun interactive-blink-matching-open ()
  89.             "Indicate momentarily the start of sexp before point."
  90.             (interactive)
  91.  
  92.           (let ((blink-matching-paren-distance
  93.                    (buffer-size))
  94.                   (blink-matching-paren t))
  95.               (blink-matching-open)))
  96.  
  97. 
  98. File: lispref.info,  Node: Usual Display,  Next: Display Tables,  Prev: Blinking,  Up: Display
  99.  
  100. Usual Display Conventions
  101. =========================
  102.  
  103.    The usual display conventions define how to display each character
  104. code.  You can override these conventions by setting up a display table
  105. (*note Display Tables::.).  Here are the usual display conventions:
  106.  
  107.    * Character codes 32 through 126 map to glyph codes 32 through 126.
  108.      Normally this means they display as themselves.
  109.  
  110.    * Character code 9 is a horizontal tab.  It displays as whitespace
  111.      up to a position determined by `tab-width'.
  112.  
  113.    * Character code 10 is a newline.
  114.  
  115.    * All other codes in the range 0 through 31, and code 127, display
  116.      in one of two ways according to the value of `ctl-arrow'.  If it is
  117.      non-`nil', these codes map to sequences of two glyphs, where the
  118.      first glyph is the ASCII code for `^'.  (A display table can
  119.      specify a glyph to use instead of `^'.)  Otherwise, these codes map
  120.      just like the codes in the range 128 to 255.
  121.  
  122.    * Character codes 128 through 255 map to sequences of four glyphs,
  123.      where the first glyph is the ASCII code for `\', and the others are
  124.      digit characters representing the code in octal.  (A display table
  125.      can specify a glyph to use instead of `\'.)
  126.  
  127.    The usual display conventions apply even when there is a display
  128. table, for any character whose entry in the active display table is
  129. `nil'.  Thus, when you set up a display table, you need only specify
  130. the characters for which you want unusual behavior.
  131.  
  132.    These variables affect the way certain characters are displayed on
  133. the screen.  Since they change the number of columns the characters
  134. occupy, they also affect the indentation functions.
  135.  
  136.  - User Option: ctl-arrow
  137.      This buffer-local variable controls how control characters are
  138.      displayed.  If it is non-`nil', they are displayed as a caret
  139.      followed by the character: `^A'.  If it is `nil', they are
  140.      displayed as a backslash followed by three octal digits: `\001'.
  141.  
  142.  - Variable: default-ctl-arrow
  143.      The value of this variable is the default value for `ctl-arrow' in
  144.      buffers that do not override it.  *Note Default Value::.
  145.  
  146.  - User Option: tab-width
  147.      The value of this variable is the spacing between tab stops used
  148.      for displaying tab characters in Emacs buffers.  The default is 8.
  149.      Note that this feature is completely independent from the
  150.      user-settable tab stops used by the command `tab-to-tab-stop'.
  151.      *Note Indent Tabs::.
  152.  
  153. 
  154. File: lispref.info,  Node: Display Tables,  Next: Beeping,  Prev: Usual Display,  Up: Display
  155.  
  156. Display Tables
  157. ==============
  158.  
  159.    You can use the "display table" feature to control how all 256
  160. possible character codes display on the screen.  This is useful for
  161. displaying European languages that have letters not in the ASCII
  162. character set.
  163.  
  164.    The display table maps each character code into a sequence of
  165. "runes", each rune being an image that takes up one character position
  166. on the screen.  You can also define how to display each rune on your
  167. terminal, using the "rune table".
  168.  
  169. * Menu:
  170.  
  171. * Display Table Format::    What a display table consists of.
  172. * Active Display Table::    How XEmacs selects a display table to use.
  173. * Character Descriptors::    Format of an individual element of a
  174.                   display table.
  175.  
  176. 
  177. File: lispref.info,  Node: Display Table Format,  Next: Active Display Table,  Up: Display Tables
  178.  
  179. Display Table Format
  180. --------------------
  181.  
  182.    A display table is an array of 256 elements. (In FSF Emacs, a display
  183. table is 262 elements.  The six extra elements specify the truncation
  184. and continuation glyphs, etc.  This method is very kludgey, and in
  185. XEmacs the variables `truncation-glyph', `continuation-glyph', etc. are
  186. used.  *Note Truncation::.)
  187.  
  188.  - Function: make-display-table
  189.      This creates and returns a display table.  The table initially has
  190.      `nil' in all elements.
  191.  
  192.    The 256 elements correspond to character codes; the Nth element says
  193. how to display the character code N.  The value should be `nil', a
  194. string, a glyph, or a vector of strings and glyphs (*note Character
  195. Descriptors::.).  If an element is `nil', it says to display that
  196. character according to the usual display conventions (*note Usual
  197. Display::.).
  198.  
  199.    If you use the display table to change the display of newline
  200. characters, the whole buffer will be displayed as one long "line."
  201.  
  202.    For example, here is how to construct a display table that mimics the
  203. effect of setting `ctl-arrow' to a non-`nil' value:
  204.  
  205.      (setq disptab (make-display-table))
  206.      (let ((i 0))
  207.        (while (< i 32)
  208.          (or (= i ?\t) (= i ?\n)
  209.              (aset disptab i (concat "^" (char-to-string (+ i 64)))))
  210.          (setq i (1+ i)))
  211.        (aset disptab 127 "^?"))
  212.  
  213. 
  214. File: lispref.info,  Node: Active Display Table,  Next: Character Descriptors,  Prev: Display Table Format,  Up: Display Tables
  215.  
  216. Active Display Table
  217. --------------------
  218.  
  219.    The active display table is controlled by the variable
  220. `current-display-table'.  This is a specifier, which means that you can
  221. specify separate values for it in individual buffers, windows, frames,
  222. and devices, as well as a global value.  It also means that you cannot
  223. set this variable using `setq'; use `set-specifier' instead.  *Note
  224. Specifiers::. (FSF Emacs uses `window-display-table',
  225. `buffer-display-table', `standard-display-table', etc. to control the
  226. display table.  However, specifiers are a cleaner and more powerful way
  227. of doing the same thing.  FSF Emacs also uses a different format for
  228. the contents of a display table, using additional indirection to a
  229. "glyph table" and such.  Note that "glyph" has a different meaning in
  230. XEmacs.)
  231.  
  232.    Individual faces can also specify an overriding display table; this
  233. is set using `set-face-display-table'.  *Note Faces::.
  234.  
  235.    If no display table can be determined for a particular window, then
  236. XEmacs uses the usual display conventions.  *Note Usual Display::.
  237.  
  238. 
  239. File: lispref.info,  Node: Character Descriptors,  Prev: Active Display Table,  Up: Display Tables
  240.  
  241. Character Descriptors
  242. ---------------------
  243.  
  244.    Each element of the display-table vector describes how to display a
  245. particular character and is called a "character descriptor".  A
  246. character descriptor can be:
  247.  
  248. a string
  249.      Display this particular string wherever the character is to be
  250.      displayed.
  251.  
  252. a glyph
  253.      Display this particular glyph wherever the character is to be
  254.      displayed.
  255.  
  256. a vector
  257.      The vector may contain strings and/or glyphs.  Display the
  258.      elements of the vector one after another wherever the character is
  259.      to be displayed.
  260.  
  261. `nil'
  262.      Display according to the standard interpretation (*note Usual
  263.      Display::.).
  264.  
  265. 
  266. File: lispref.info,  Node: Beeping,  Prev: Display Tables,  Up: Display
  267.  
  268. Beeping
  269. =======
  270.  
  271.    You can make XEmacs ring a bell, play a sound, or blink the screen to
  272. attract the user's attention.  Be conservative about how often you do
  273. this; frequent bells can become irritating.  Also be careful not to use
  274. beeping alone when signaling an error is appropriate.  (*Note Errors::.)
  275.  
  276.  - Function: ding &optional DONT-TERMINATE SOUND DEVICE
  277.      This function beeps, or flashes the screen (see `visible-bell'
  278.      below).  It also terminates any keyboard macro currently executing
  279.      unless DONT-TERMINATE is non-`nil'.  If SOUND is specified, it
  280.      should be a symbol specifying which sound to make.  This sound
  281.      will be played if `visible-bell' is `nil'. (This only works if
  282.      sound support was compiled into the executable and you are running
  283.      on the console of a Sun SparcStation, SGI, or HP9000s700.
  284.      Otherwise you just get a beep.) The optional third argument
  285.      specifies what device to make the sound on, and defaults to the
  286.      selected device.
  287.  
  288.  - Function: beep &optional DONT-TERMINATE SOUND DEVICE
  289.      This is a synonym for `ding'.
  290.  
  291.  - User Option: visible-bell
  292.      This variable determines whether XEmacs should flash the screen to
  293.      represent a bell.  Non-`nil' means yes, `nil' means no.  On TTY
  294.      devices, this is effective only if the Termcap entry for the
  295.      terminal type has the visible bell flag (`vb') set.
  296.  
  297.  - Variable: sound-alist
  298.      This variable holds an alist associating names with sounds.  When
  299.      `beep' or `ding' is called with one of the name symbols, the
  300.      associated sound will be generated instead of the standard beep.
  301.  
  302.      Each element of `sound-alist' is a list describing a sound.  The
  303.      first element of the list is the name of the sound being defined.
  304.      Subsequent elements of the list are alternating keyword/value
  305.      pairs:
  306.  
  307.     `sound'
  308.           A string of raw sound data, or the name of another sound to
  309.           play.  The symbol `t' here means use the default X beep.
  310.  
  311.     `volume'
  312.           An integer from 0-100, defaulting to `bell-volume'.
  313.  
  314.     `pitch'
  315.           If using the default X beep, the pitch (Hz) to generate.
  316.  
  317.     `duration'
  318.           If using the default X beep, the duration (milliseconds).
  319.  
  320.      For compatibility, elements of `sound-alist' may also be:
  321.  
  322.         * `( sound-name . <sound> )'
  323.  
  324.         * `( sound-name <volume> <sound> )'
  325.  
  326.      You should probably add things to this list by calling the function
  327.      `load-sound-file'.
  328.  
  329.      Caveats:
  330.  
  331.         - You can only play audio data if running on the console screen
  332.           of a Sun SparcStation, SGI, or HP9000s700.
  333.  
  334.         - The pitch, duration, and volume options are available
  335.           everywhere, but many X servers ignore the `pitch' option.
  336.  
  337.      The following beep-types are used by XEmacs itself:
  338.  
  339.     `auto-save-error'
  340.           when an auto-save does not succeed
  341.  
  342.     `command-error'
  343.           when the XEmacs command loop catches an error
  344.  
  345.     `undefined-key'
  346.           when you type a key that is undefined
  347.  
  348.     `undefined-click'
  349.           when you use an undefined mouse-click combination
  350.  
  351.     `no-completion'
  352.           during completing-read
  353.  
  354.     `y-or-n-p'
  355.           when you type something other than 'y' or 'n'
  356.  
  357.     `yes-or-no-p'
  358.           when you type something other than 'yes' or 'no'
  359.  
  360.     `default'
  361.           used when nothing else is appropriate.
  362.  
  363.      Other lisp packages may use other beep types, but these are the
  364.      ones that the C kernel of XEmacs uses.
  365.  
  366.  - User Option: bell-volume
  367.      This variable specifies the default volume for sounds, from 0 to
  368.      100.
  369.  
  370.  - Command: load-default-sounds
  371.      This function loads and installs some sound files as beep-types.
  372.  
  373.  - Command: load-sound-file FILENAME SOUND-NAME &optional VOLUME
  374.      This function reads in an audio file and adds it to `sound-alist'.
  375.      The sound file must be in the Sun/NeXT U-LAW format.  SOUND-NAME
  376.      should be a symbol, specifying the name of the sound.  If VOLUME
  377.      is specified, the sound will be played at that volume; otherwise,
  378.      the value of BELL-VOLUME will be used.
  379.  
  380.  - Function: play-sound SOUND &optional VOLUME DEVICE
  381.      This function plays sound SOUND, which should be a symbol
  382.      mentioned in `sound-alist'.  If VOLUME is specified, it overrides
  383.      the value (if any) specified in `sound-alist'.  DEVICE specifies
  384.      the device to play the sound on, and defaults to the selected
  385.      device.
  386.  
  387.  - Command: play-sound-file FILE &optional VOLUME DEVICE
  388.      This function plays the named sound file at volume VOLUME, which
  389.      defaults to `bell-volume'.  DEVICE specifies the device to play
  390.      the sound on, and defaults to the selected device.
  391.  
  392. 
  393. File: lispref.info,  Node: Processes,  Next: System Interface,  Prev: Display,  Up: Top
  394.  
  395. Processes
  396. *********
  397.  
  398.    In the terminology of operating systems, a "process" is a space in
  399. which a program can execute.  XEmacs runs in a process.  Emacs Lisp
  400. programs can invoke other programs in processes of their own.  These are
  401. called "subprocesses" or "child processes" of the XEmacs process, which
  402. is their "parent process".
  403.  
  404.    A subprocess of XEmacs may be "synchronous" or "asynchronous",
  405. depending on how it is created.  When you create a synchronous
  406. subprocess, the Lisp program waits for the subprocess to terminate
  407. before continuing execution.  When you create an asynchronous
  408. subprocess, it can run in parallel with the Lisp program.  This kind of
  409. subprocess is represented within XEmacs by a Lisp object which is also
  410. called a "process".  Lisp programs can use this object to communicate
  411. with the subprocess or to control it.  For example, you can send
  412. signals, obtain status information, receive output from the process, or
  413. send input to it.
  414.  
  415.  - Function: processp OBJECT
  416.      This function returns `t' if OBJECT is a process, `nil' otherwise.
  417.  
  418. * Menu:
  419.  
  420. * Subprocess Creation::      Functions that start subprocesses.
  421. * Synchronous Processes::    Details of using synchronous subprocesses.
  422. * MS-DOS Subprocesses::      On MS-DOS, you must indicate text vs binary
  423.                                 for data sent to and from a subprocess.
  424. * Asynchronous Processes::   Starting up an asynchronous subprocess.
  425. * Deleting Processes::       Eliminating an asynchronous subprocess.
  426. * Process Information::      Accessing run-status and other attributes.
  427. * Input to Processes::       Sending input to an asynchronous subprocess.
  428. * Signals to Processes::     Stopping, continuing or interrupting
  429.                                an asynchronous subprocess.
  430. * Output from Processes::    Collecting output from an asynchronous subprocess.
  431. * Sentinels::                Sentinels run when process run-status changes.
  432. * Process Window Size::      Changing the logical window size of a process.
  433. * Transaction Queues::         Transaction-based communication with subprocesses.
  434. * Network::                  Opening network connections.
  435.  
  436. 
  437. File: lispref.info,  Node: Subprocess Creation,  Next: Synchronous Processes,  Up: Processes
  438.  
  439. Functions that Create Subprocesses
  440. ==================================
  441.  
  442.    There are three functions that create a new subprocess in which to
  443. run a program.  One of them, `start-process', creates an asynchronous
  444. process and returns a process object (*note Asynchronous Processes::.).
  445. The other two, `call-process' and `call-process-region', create a
  446. synchronous process and do not return a process object (*note
  447. Synchronous Processes::.).
  448.  
  449.    Synchronous and asynchronous processes are explained in following
  450. sections.  Since the three functions are all called in a similar
  451. fashion, their common arguments are described here.
  452.  
  453.    In all cases, the function's PROGRAM argument specifies the program
  454. to be run.  An error is signaled if the file is not found or cannot be
  455. executed.  If the file name is relative, the variable `exec-path'
  456. contains a list of directories to search.  Emacs initializes
  457. `exec-path' when it starts up, based on the value of the environment
  458. variable `PATH'.  The standard file name constructs, `~', `.', and
  459. `..', are interpreted as usual in `exec-path', but environment variable
  460. substitutions (`$HOME', etc.) are not recognized; use
  461. `substitute-in-file-name' to perform them (*note File Name
  462. Expansion::.).
  463.  
  464.    Each of the subprocess-creating functions has a BUFFER-OR-NAME
  465. argument which specifies where the standard output from the program will
  466. go.  If BUFFER-OR-NAME is `nil', that says to discard the output unless
  467. a filter function handles it.  (*Note Filter Functions::, and *Note
  468. Read and Print::.)  Normally, you should avoid having multiple
  469. processes send output to the same buffer because their output would be
  470. intermixed randomly.
  471.  
  472.    All three of the subprocess-creating functions have a `&rest'
  473. argument, ARGS.  The ARGS must all be strings, and they are supplied to
  474. PROGRAM as separate command line arguments.  Wildcard characters and
  475. other shell constructs are not allowed in these strings, since they are
  476. passed directly to the specified program.
  477.  
  478.    *Please note:* The argument PROGRAM contains only the name of the
  479. program; it may not contain any command-line arguments.  You must use
  480. ARGS to provide those.
  481.  
  482.    The subprocess gets its current directory from the value of
  483. `default-directory' (*note File Name Expansion::.).
  484.  
  485.    The subprocess inherits its environment from XEmacs; but you can
  486. specify overrides for it with `process-environment'.  *Note System
  487. Environment::.
  488.  
  489.  - Variable: exec-directory
  490.      The value of this variable is the name of a directory (a string)
  491.      that contains programs that come with XEmacs, that are intended
  492.      for XEmacs to invoke.  The program `wakeup' is an example of such
  493.      a program; the `display-time' command uses it to get a reminder
  494.      once per minute.
  495.  
  496.  - User Option: exec-path
  497.      The value of this variable is a list of directories to search for
  498.      programs to run in subprocesses.  Each element is either the name
  499.      of a directory (i.e., a string), or `nil', which stands for the
  500.      default directory (which is the value of `default-directory').
  501.  
  502.      The value of `exec-path' is used by `call-process' and
  503.      `start-process' when the PROGRAM argument is not an absolute file
  504.      name.
  505.  
  506. 
  507. File: lispref.info,  Node: Synchronous Processes,  Next: MS-DOS Subprocesses,  Prev: Subprocess Creation,  Up: Processes
  508.  
  509. Creating a Synchronous Process
  510. ==============================
  511.  
  512.    After a "synchronous process" is created, XEmacs waits for the
  513. process to terminate before continuing.  Starting Dired is an example of
  514. this: it runs `ls' in a synchronous process, then modifies the output
  515. slightly.  Because the process is synchronous, the entire directory
  516. listing arrives in the buffer before XEmacs tries to do anything with
  517. it.
  518.  
  519.    While Emacs waits for the synchronous subprocess to terminate, the
  520. user can quit by typing `C-g'.  The first `C-g' tries to kill the
  521. subprocess with a `SIGINT' signal; but it waits until the subprocess
  522. actually terminates before quitting.  If during that time the user
  523. types another `C-g', that kills the subprocess instantly with `SIGKILL'
  524. and quits immediately.  *Note Quitting::.
  525.  
  526.    The synchronous subprocess functions returned `nil' in version 18.
  527. In version 19, they return an indication of how the process terminated.
  528.  
  529.  - Function: call-process PROGRAM &optional INFILE DESTINATION DISPLAY
  530.           &rest ARGS
  531.      This function calls PROGRAM in a separate process and waits for it
  532.      to finish.
  533.  
  534.      The standard input for the process comes from file INFILE if
  535.      INFILE is not `nil' and from `/dev/null' otherwise.  The argument
  536.      DESTINATION says where to put the process output.  Here are the
  537.      possibilities:
  538.  
  539.     a buffer
  540.           Insert the output in that buffer, before point.  This
  541.           includes both the standard output stream and the standard
  542.           error stream of the process.
  543.  
  544.     a string
  545.           Find or create a buffer with that name, then insert the
  546.           output in that buffer, before point.
  547.  
  548.     `t'
  549.           Insert the output in the current buffer, before point.
  550.  
  551.     `nil'
  552.           Discard the output.
  553.  
  554.     0
  555.           Discard the output, and return immediately without waiting
  556.           for the subprocess to finish.
  557.  
  558.           In this case, the process is not truly synchronous, since it
  559.           can run in parallel with Emacs; but you can think of it as
  560.           synchronous in that Emacs is essentially finished with the
  561.           subprocess as soon as this function returns.
  562.  
  563.     (REAL-DESTINATION ERROR-DESTINATION)
  564.           Keep the standard output stream separate from the standard
  565.           error stream; deal with the ordinary output as specified by
  566.           REAL-DESTINATION, and dispose of the error output according
  567.           to ERROR-DESTINATION.  The value `nil' means discard it, `t'
  568.           means mix it with the ordinary output, and a string specifies
  569.           a file name to redirect error output into.
  570.  
  571.           You can't directly specify a buffer to put the error output
  572.           in; that is too difficult to implement.  But you can achieve
  573.           this result by sending the error output to a temporary file
  574.           and then inserting the file into a buffer.
  575.  
  576.      If DISPLAY is non-`nil', then `call-process' redisplays the buffer
  577.      as output is inserted.  Otherwise the function does no redisplay,
  578.      and the results become visible on the screen only when XEmacs
  579.      redisplays that buffer in the normal course of events.
  580.  
  581.      The remaining arguments, ARGS, are strings that specify command
  582.      line arguments for the program.
  583.  
  584.      The value returned by `call-process' (unless you told it not to
  585.      wait) indicates the reason for process termination.  A number
  586.      gives the exit status of the subprocess; 0 means success, and any
  587.      other value means failure.  If the process terminated with a
  588.      signal, `call-process' returns a string describing the signal.
  589.  
  590.      In the examples below, the buffer `foo' is current.
  591.  
  592.           (call-process "pwd" nil t)
  593.                => nil
  594.           
  595.           ---------- Buffer: foo ----------
  596.           /usr/user/lewis/manual
  597.           ---------- Buffer: foo ----------
  598.  
  599.           (call-process "grep" nil "bar" nil "lewis" "/etc/passwd")
  600.                => nil
  601.           
  602.           ---------- Buffer: bar ----------
  603.           lewis:5LTsHm66CSWKg:398:21:Bil Lewis:/user/lewis:/bin/csh
  604.           
  605.           ---------- Buffer: bar ----------
  606.  
  607.      The `insert-directory' function contains a good example of the use
  608.      of `call-process':
  609.  
  610.           (call-process insert-directory-program nil t nil switches
  611.                         (if full-directory-p
  612.                             (concat (file-name-as-directory file) ".")
  613.                           file))
  614.  
  615.  - Function: call-process-region START END PROGRAM &optional DELETE
  616.           DESTINATION DISPLAY &rest ARGS
  617.      This function sends the text between START to END as standard
  618.      input to a process running PROGRAM.  It deletes the text sent if
  619.      DELETE is non-`nil'; this is useful when BUFFER is `t', to insert
  620.      the output in the current buffer.
  621.  
  622.      The arguments DESTINATION and DISPLAY control what to do with the
  623.      output from the subprocess, and whether to update the display as
  624.      it comes in.  For details, see the description of `call-process',
  625.      above.  If DESTINATION is the integer 0, `call-process-region'
  626.      discards the output and returns `nil' immediately, without waiting
  627.      for the subprocess to finish.
  628.  
  629.      The remaining arguments, ARGS, are strings that specify command
  630.      line arguments for the program.
  631.  
  632.      The return value of `call-process-region' is just like that of
  633.      `call-process': `nil' if you told it to return without waiting;
  634.      otherwise, a number or string which indicates how the subprocess
  635.      terminated.
  636.  
  637.      In the following example, we use `call-process-region' to run the
  638.      `cat' utility, with standard input being the first five characters
  639.      in buffer `foo' (the word `input').  `cat' copies its standard
  640.      input into its standard output.  Since the argument DESTINATION is
  641.      `t', this output is inserted in the current buffer.
  642.  
  643.           ---------- Buffer: foo ----------
  644.           input-!-
  645.           ---------- Buffer: foo ----------
  646.  
  647.           (call-process-region 1 6 "cat" nil t)
  648.                => nil
  649.           
  650.           ---------- Buffer: foo ----------
  651.           inputinput-!-
  652.           ---------- Buffer: foo ----------
  653.  
  654.      The `shell-command-on-region' command uses `call-process-region'
  655.      like this:
  656.  
  657.           (call-process-region
  658.            start end
  659.            shell-file-name      ; Name of program.
  660.            nil                  ; Do not delete region.
  661.            buffer               ; Send output to `buffer'.
  662.            nil                  ; No redisplay during output.
  663.            "-c" command)        ; Arguments for the shell.
  664.  
  665. 
  666. File: lispref.info,  Node: MS-DOS Subprocesses,  Next: Asynchronous Processes,  Prev: Synchronous Processes,  Up: Processes
  667.  
  668. MS-DOS Subprocesses
  669. ===================
  670.  
  671.    On MS-DOS, you must indicate whether the data going to and from a
  672. synchronous subprocess are text or binary.  Text data requires
  673. translation between the end-of-line convention used within Emacs (a
  674. single newline character) and the convention used outside Emacs (the
  675. two-character sequence, CRLF).
  676.  
  677.    The variable `binary-process-input' applies to input sent to the
  678. subprocess, and `binary-process-output' applies to output received from
  679. it.  A non-`nil' value means the data is non-text; `nil' means the data
  680. is text, and calls for conversion.
  681.  
  682.  - Variable: binary-process-input
  683.      If this variable is `nil', convert newlines to CRLF sequences in
  684.      the input to a synchronous subprocess.
  685.  
  686.  - Variable: binary-process-output
  687.      If this variable is `nil', convert CRLF sequences to newlines in
  688.      the output from a synchronous subprocess.
  689.  
  690.    *Note Files and MS-DOS::, for related information.
  691.  
  692. 
  693. File: lispref.info,  Node: Asynchronous Processes,  Next: Deleting Processes,  Prev: MS-DOS Subprocesses,  Up: Processes
  694.  
  695. Creating an Asynchronous Process
  696. ================================
  697.  
  698.    After an "asynchronous process" is created, Emacs and the Lisp
  699. program both continue running immediately.  The process may thereafter
  700. run in parallel with Emacs, and the two may communicate with each other
  701. using the functions described in following sections.  Here we describe
  702. how to create an asynchronous process with `start-process'.
  703.  
  704.  - Function: start-process NAME BUFFER-OR-NAME PROGRAM &rest ARGS
  705.      This function creates a new asynchronous subprocess and starts the
  706.      program PROGRAM running in it.  It returns a process object that
  707.      stands for the new subprocess in Lisp.  The argument NAME
  708.      specifies the name for the process object; if a process with this
  709.      name already exists, then NAME is modified (by adding `<1>', etc.)
  710.      to be unique.  The buffer BUFFER-OR-NAME is the buffer to
  711.      associate with the process.
  712.  
  713.      The remaining arguments, ARGS, are strings that specify command
  714.      line arguments for the program.
  715.  
  716.      In the example below, the first process is started and runs
  717.      (rather, sleeps) for 100 seconds.  Meanwhile, the second process
  718.      is started, and given the name `my-process<1>' for the sake of
  719.      uniqueness.  It inserts the directory listing at the end of the
  720.      buffer `foo', before the first process finishes.  Then it
  721.      finishes, and a message to that effect is inserted in the buffer.
  722.      Much later, the first process finishes, and another message is
  723.      inserted in the buffer for it.
  724.  
  725.           (start-process "my-process" "foo" "sleep" "100")
  726.                => #<process my-process>
  727.  
  728.           (start-process "my-process" "foo" "ls" "-l" "/user/lewis/bin")
  729.                => #<process my-process<1>>
  730.           
  731.           ---------- Buffer: foo ----------
  732.           total 2
  733.           lrwxrwxrwx  1 lewis     14 Jul 22 10:12 gnuemacs --> /emacs
  734.           -rwxrwxrwx  1 lewis     19 Jul 30 21:02 lemon
  735.           
  736.           Process my-process<1> finished
  737.           
  738.           Process my-process finished
  739.           ---------- Buffer: foo ----------
  740.  
  741.  - Function: start-process-shell-command NAME BUFFER-OR-NAME COMMAND
  742.           &rest COMMAND-ARGS
  743.      This function is like `start-process' except that it uses a shell
  744.      to execute the specified command.  The argument COMMAND is a shell
  745.      command name, and COMMAND-ARGS are the arguments for the shell
  746.      command.
  747.  
  748.  - Variable: process-connection-type
  749.      This variable controls the type of device used to communicate with
  750.      asynchronous subprocesses.  If it is non-`nil', then PTYs are
  751.      used, when available.  Otherwise, pipes are used.
  752.  
  753.      PTYs are usually preferable for processes visible to the user, as
  754.      in Shell mode, because they allow job control (`C-c', `C-z', etc.)
  755.      to work between the process and its children whereas pipes do not.
  756.      For subprocesses used for internal purposes by programs, it is
  757.      often better to use a pipe, because they are more efficient.  In
  758.      addition, the total number of PTYs is limited on many systems and
  759.      it is good not to waste them.
  760.  
  761.      The value `process-connection-type' is used when `start-process'
  762.      is called.  So you can specify how to communicate with one
  763.      subprocess by binding the variable around the call to
  764.      `start-process'.
  765.  
  766.           (let ((process-connection-type nil))  ; Use a pipe.
  767.             (start-process ...))
  768.  
  769.      To determine whether a given subprocess actually got a pipe or a
  770.      PTY, use the function `process-tty-name' (*note Process
  771.      Information::.).
  772.  
  773. 
  774. File: lispref.info,  Node: Deleting Processes,  Next: Process Information,  Prev: Asynchronous Processes,  Up: Processes
  775.  
  776. Deleting Processes
  777. ==================
  778.  
  779.    "Deleting a process" disconnects XEmacs immediately from the
  780. subprocess, and removes it from the list of active processes.  It sends
  781. a signal to the subprocess to make the subprocess terminate, but this is
  782. not guaranteed to happen immediately.  The process object itself
  783. continues to exist as long as other Lisp objects point to it.
  784.  
  785.    You can delete a process explicitly at any time.  Processes are
  786. deleted automatically after they terminate, but not necessarily right
  787. away.  If you delete a terminated process explicitly before it is
  788. deleted automatically, no harm results.
  789.  
  790.  - Variable: delete-exited-processes
  791.      This variable controls automatic deletion of processes that have
  792.      terminated (due to calling `exit' or to a signal).  If it is
  793.      `nil', then they continue to exist until the user runs
  794.      `list-processes'.  Otherwise, they are deleted immediately after
  795.      they exit.
  796.  
  797.  - Function: delete-process NAME
  798.      This function deletes the process associated with NAME, killing it
  799.      with a `SIGHUP' signal.  The argument NAME may be a process, the
  800.      name of a process, a buffer, or the name of a buffer.
  801.  
  802.           (delete-process "*shell*")
  803.                => nil
  804.  
  805.  - Function: process-kill-without-query PROCESS &optional
  806.           REQUIRE-QUERY-P
  807.      This function declares that XEmacs need not query the user if
  808.      PROCESS is still running when XEmacs is exited.  The process will
  809.      be deleted silently.  If REQUIRE-QUERY-P is non-`nil', then XEmacs
  810.      *will* query the user (this is the default).  The return value is
  811.      `t' if a query was formerly required, and `nil' otherwise.
  812.  
  813.           (process-kill-without-query (get-process "shell"))
  814.                => t
  815.  
  816. 
  817. File: lispref.info,  Node: Process Information,  Next: Input to Processes,  Prev: Deleting Processes,  Up: Processes
  818.  
  819. Process Information
  820. ===================
  821.  
  822.    Several functions return information about processes.
  823. `list-processes' is provided for interactive use.
  824.  
  825.  - Command: list-processes
  826.      This command displays a listing of all living processes.  In
  827.      addition, it finally deletes any process whose status was `Exited'
  828.      or `Signaled'.  It returns `nil'.
  829.  
  830.  - Function: process-list
  831.      This function returns a list of all processes that have not been
  832.      deleted.
  833.  
  834.           (process-list)
  835.                => (#<process display-time> #<process shell>)
  836.  
  837.  - Function: get-process NAME
  838.      This function returns the process named NAME, or `nil' if there is
  839.      none.  An error is signaled if NAME is not a string.
  840.  
  841.           (get-process "shell")
  842.                => #<process shell>
  843.  
  844.  - Function: process-command PROCESS
  845.      This function returns the command that was executed to start
  846.      PROCESS.  This is a list of strings, the first string being the
  847.      program executed and the rest of the strings being the arguments
  848.      that were given to the program.
  849.  
  850.           (process-command (get-process "shell"))
  851.                => ("/bin/csh" "-i")
  852.  
  853.  - Function: process-id PROCESS
  854.      This function returns the PID of PROCESS.  This is an integer that
  855.      distinguishes the process PROCESS from all other processes running
  856.      on the same computer at the current time.  The PID of a process is
  857.      chosen by the operating system kernel when the process is started
  858.      and remains constant as long as the process exists.
  859.  
  860.  - Function: process-name PROCESS
  861.      This function returns the name of PROCESS.
  862.  
  863.  - Function: process-status PROCESS-NAME
  864.      This function returns the status of PROCESS-NAME as a symbol.  The
  865.      argument PROCESS-NAME must be a process, a buffer, a process name
  866.      (string) or a buffer name (string).
  867.  
  868.      The possible values for an actual subprocess are:
  869.  
  870.     `run'
  871.           for a process that is running.
  872.  
  873.     `stop'
  874.           for a process that is stopped but continuable.
  875.  
  876.     `exit'
  877.           for a process that has exited.
  878.  
  879.     `signal'
  880.           for a process that has received a fatal signal.
  881.  
  882.     `open'
  883.           for a network connection that is open.
  884.  
  885.     `closed'
  886.           for a network connection that is closed.  Once a connection
  887.           is closed, you cannot reopen it, though you might be able to
  888.           open a new connection to the same place.
  889.  
  890.     `nil'
  891.           if PROCESS-NAME is not the name of an existing process.
  892.  
  893.           (process-status "shell")
  894.                => run
  895.  
  896.           (process-status (get-buffer "*shell*"))
  897.                => run
  898.  
  899.           x
  900.                => #<process xx<1>>
  901.           (process-status x)
  902.                => exit
  903.  
  904.      For a network connection, `process-status' returns one of the
  905.      symbols `open' or `closed'.  The latter means that the other side
  906.      closed the connection, or XEmacs did `delete-process'.
  907.  
  908.      In earlier Emacs versions (prior to version 19), the status of a
  909.      network connection was `run' if open, and `exit' if closed.
  910.  
  911.  - Function: process-kill-without-query-p PROCESS
  912.      This function returns whether PROCESS will be killed without
  913.      querying the user, if it is running when XEmacs is exited.  The
  914.      default value is `nil'.
  915.  
  916.  - Function: process-exit-status PROCESS
  917.      This function returns the exit status of PROCESS or the signal
  918.      number that killed it.  (Use the result of `process-status' to
  919.      determine which of those it is.)  If PROCESS has not yet
  920.      terminated, the value is 0.
  921.  
  922.  - Function: process-tty-name PROCESS
  923.      This function returns the terminal name that PROCESS is using for
  924.      its communication with Emacs--or `nil' if it is using pipes
  925.      instead of a terminal (see `process-connection-type' in *Note
  926.      Asynchronous Processes::).
  927.  
  928. 
  929. File: lispref.info,  Node: Input to Processes,  Next: Signals to Processes,  Prev: Process Information,  Up: Processes
  930.  
  931. Sending Input to Processes
  932. ==========================
  933.  
  934.    Asynchronous subprocesses receive input when it is sent to them by
  935. XEmacs, which is done with the functions in this section.  You must
  936. specify the process to send input to, and the input data to send.  The
  937. data appears on the "standard input" of the subprocess.
  938.  
  939.    Some operating systems have limited space for buffered input in a
  940. PTY.  On these systems, Emacs sends an EOF periodically amidst the
  941. other characters, to force them through.  For most programs, these EOFs
  942. do no harm.
  943.  
  944.  - Function: process-send-string PROCESS-NAME STRING
  945.      This function sends PROCESS-NAME the contents of STRING as
  946.      standard input.  The argument PROCESS-NAME must be a process or
  947.      the name of a process.  If it is `nil', the current buffer's
  948.      process is used.
  949.  
  950.      The function returns `nil'.
  951.  
  952.           (process-send-string "shell<1>" "ls\n")
  953.                => nil
  954.  
  955.           ---------- Buffer: *shell* ----------
  956.           ...
  957.           introduction.texi               syntax-tables.texi~
  958.           introduction.texi~              text.texi
  959.           introduction.txt                text.texi~
  960.           ...
  961.           ---------- Buffer: *shell* ----------
  962.  
  963.  - Command: process-send-region PROCESS-NAME START END
  964.      This function sends the text in the region defined by START and
  965.      END as standard input to PROCESS-NAME, which is a process or a
  966.      process name.  (If it is `nil', the current buffer's process is
  967.      used.)
  968.  
  969.      An error is signaled unless both START and END are integers or
  970.      markers that indicate positions in the current buffer.  (It is
  971.      unimportant which number is larger.)
  972.  
  973.  - Function: process-send-eof &optional PROCESS-NAME
  974.      This function makes PROCESS-NAME see an end-of-file in its input.
  975.      The EOF comes after any text already sent to it.
  976.  
  977.      If PROCESS-NAME is not supplied, or if it is `nil', then this
  978.      function sends the EOF to the current buffer's process.  An error
  979.      is signaled if the current buffer has no process.
  980.  
  981.      The function returns PROCESS-NAME.
  982.  
  983.           (process-send-eof "shell")
  984.                => "shell"
  985.  
  986. 
  987. File: lispref.info,  Node: Signals to Processes,  Next: Output from Processes,  Prev: Input to Processes,  Up: Processes
  988.  
  989. Sending Signals to Processes
  990. ============================
  991.  
  992.    "Sending a signal" to a subprocess is a way of interrupting its
  993. activities.  There are several different signals, each with its own
  994. meaning.  The set of signals and their names is defined by the operating
  995. system.  For example, the signal `SIGINT' means that the user has typed
  996. `C-c', or that some analogous thing has happened.
  997.  
  998.    Each signal has a standard effect on the subprocess.  Most signals
  999. kill the subprocess, but some stop or resume execution instead.  Most
  1000. signals can optionally be handled by programs; if the program handles
  1001. the signal, then we can say nothing in general about its effects.
  1002.  
  1003.    The set of signals and their names is defined by the operating
  1004. system; XEmacs has facilities for sending only a few of the signals
  1005. that are defined.  XEmacs can send signals only to its own subprocesses.
  1006.  
  1007.    You can send signals explicitly by calling the functions in this
  1008. section.  XEmacs also sends signals automatically at certain times:
  1009. killing a buffer sends a `SIGHUP' signal to all its associated
  1010. processes; killing XEmacs sends a `SIGHUP' signal to all remaining
  1011. processes.  (`SIGHUP' is a signal that usually indicates that the user
  1012. hung up the phone.)
  1013.  
  1014.    Each of the signal-sending functions takes two optional arguments:
  1015. PROCESS-NAME and CURRENT-GROUP.
  1016.  
  1017.    The argument PROCESS-NAME must be either a process, the name of one,
  1018. or `nil'.  If it is `nil', the process defaults to the process
  1019. associated with the current buffer.  An error is signaled if
  1020. PROCESS-NAME does not identify a process.
  1021.  
  1022.    The argument CURRENT-GROUP is a flag that makes a difference when
  1023. you are running a job-control shell as an XEmacs subprocess.  If it is
  1024. non-`nil', then the signal is sent to the current process-group of the
  1025. terminal that XEmacs uses to communicate with the subprocess.  If the
  1026. process is a job-control shell, this means the shell's current subjob.
  1027. If it is `nil', the signal is sent to the process group of the
  1028. immediate subprocess of XEmacs.  If the subprocess is a job-control
  1029. shell, this is the shell itself.
  1030.  
  1031.    The flag CURRENT-GROUP has no effect when a pipe is used to
  1032. communicate with the subprocess, because the operating system does not
  1033. support the distinction in the case of pipes.  For the same reason,
  1034. job-control shells won't work when a pipe is used.  See
  1035. `process-connection-type' in *Note Asynchronous Processes::.
  1036.  
  1037.  - Function: interrupt-process &optional PROCESS-NAME CURRENT-GROUP
  1038.      This function interrupts the process PROCESS-NAME by sending the
  1039.      signal `SIGINT'.  Outside of XEmacs, typing the "interrupt
  1040.      character" (normally `C-c' on some systems, and `DEL' on others)
  1041.      sends this signal.  When the argument CURRENT-GROUP is non-`nil',
  1042.      you can think of this function as "typing `C-c'" on the terminal
  1043.      by which XEmacs talks to the subprocess.
  1044.  
  1045.  - Function: kill-process &optional PROCESS-NAME CURRENT-GROUP
  1046.      This function kills the process PROCESS-NAME by sending the signal
  1047.      `SIGKILL'.  This signal kills the subprocess immediately, and
  1048.      cannot be handled by the subprocess.
  1049.  
  1050.  - Function: quit-process &optional PROCESS-NAME CURRENT-GROUP
  1051.      This function sends the signal `SIGQUIT' to the process
  1052.      PROCESS-NAME.  This signal is the one sent by the "quit character"
  1053.      (usually `C-b' or `C-\') when you are not inside XEmacs.
  1054.  
  1055.  - Function: stop-process &optional PROCESS-NAME CURRENT-GROUP
  1056.      This function stops the process PROCESS-NAME by sending the signal
  1057.      `SIGTSTP'.  Use `continue-process' to resume its execution.
  1058.  
  1059.      On systems with job control, the "stop character" (usually `C-z')
  1060.      sends this signal (outside of XEmacs).  When CURRENT-GROUP is
  1061.      non-`nil', you can think of this function as "typing `C-z'" on the
  1062.      terminal XEmacs uses to communicate with the subprocess.
  1063.  
  1064.  - Function: continue-process &optional PROCESS-NAME CURRENT-GROUP
  1065.      This function resumes execution of the process PROCESS by sending
  1066.      it the signal `SIGCONT'.  This presumes that PROCESS-NAME was
  1067.      stopped previously.
  1068.  
  1069.  - Function: signal-process PID SIGNAL
  1070.      This function sends a signal to process PID, which need not be a
  1071.      child of XEmacs.  The argument SIGNAL specifies which signal to
  1072.      send; it should be an integer.
  1073.  
  1074. 
  1075. File: lispref.info,  Node: Output from Processes,  Next: Sentinels,  Prev: Signals to Processes,  Up: Processes
  1076.  
  1077. Receiving Output from Processes
  1078. ===============================
  1079.  
  1080.    There are two ways to receive the output that a subprocess writes to
  1081. its standard output stream.  The output can be inserted in a buffer,
  1082. which is called the associated buffer of the process, or a function
  1083. called the "filter function" can be called to act on the output.  If
  1084. the process has no buffer and no filter function, its output is
  1085. discarded.
  1086.  
  1087. * Menu:
  1088.  
  1089. * Process Buffers::       If no filter, output is put in a buffer.
  1090. * Filter Functions::      Filter functions accept output from the process.
  1091. * Accepting Output::      Explicitly permitting subprocess output.
  1092.                             Waiting for subprocess output.
  1093.  
  1094. 
  1095. File: lispref.info,  Node: Process Buffers,  Next: Filter Functions,  Up: Output from Processes
  1096.  
  1097. Process Buffers
  1098. ---------------
  1099.  
  1100.    A process can (and usually does) have an "associated buffer", which
  1101. is an ordinary Emacs buffer that is used for two purposes: storing the
  1102. output from the process, and deciding when to kill the process.  You
  1103. can also use the buffer to identify a process to operate on, since in
  1104. normal practice only one process is associated with any given buffer.
  1105. Many applications of processes also use the buffer for editing input to
  1106. be sent to the process, but this is not built into Emacs Lisp.
  1107.  
  1108.    Unless the process has a filter function (*note Filter Functions::.),
  1109. its output is inserted in the associated buffer.  The position to insert
  1110. the output is determined by the `process-mark', which is then updated
  1111. to point to the end of the text just inserted.  Usually, but not
  1112. always, the `process-mark' is at the end of the buffer.
  1113.  
  1114.  - Function: process-buffer PROCESS
  1115.      This function returns the associated buffer of the process PROCESS.
  1116.  
  1117.           (process-buffer (get-process "shell"))
  1118.                => #<buffer *shell*>
  1119.  
  1120.  - Function: process-mark PROCESS
  1121.      This function returns the process marker for PROCESS, which is the
  1122.      marker that says where to insert output from the process.
  1123.  
  1124.      If PROCESS does not have a buffer, `process-mark' returns a marker
  1125.      that points nowhere.
  1126.  
  1127.      Insertion of process output in a buffer uses this marker to decide
  1128.      where to insert, and updates it to point after the inserted text.
  1129.      That is why successive batches of output are inserted
  1130.      consecutively.
  1131.  
  1132.      Filter functions normally should use this marker in the same
  1133.      fashion as is done by direct insertion of output in the buffer.  A
  1134.      good example of a filter function that uses `process-mark' is
  1135.      found at the end of the following section.
  1136.  
  1137.      When the user is expected to enter input in the process buffer for
  1138.      transmission to the process, the process marker is useful for
  1139.      distinguishing the new input from previous output.
  1140.  
  1141.  - Function: set-process-buffer PROCESS BUFFER
  1142.      This function sets the buffer associated with PROCESS to BUFFER.
  1143.      If BUFFER is `nil', the process becomes associated with no buffer.
  1144.  
  1145.  - Function: get-buffer-process BUFFER-OR-NAME
  1146.      This function returns the process associated with BUFFER-OR-NAME.
  1147.      If there are several processes associated with it, then one is
  1148.      chosen.  (Presently, the one chosen is the one most recently
  1149.      created.)  It is usually a bad idea to have more than one process
  1150.      associated with the same buffer.
  1151.  
  1152.           (get-buffer-process "*shell*")
  1153.                => #<process shell>
  1154.  
  1155.      Killing the process's buffer deletes the process, which kills the
  1156.      subprocess with a `SIGHUP' signal (*note Signals to Processes::.).
  1157.  
  1158.